var mongoose = require('mongoose')
var Schema = mongoose.Schema
//连接数据库
mongoose.connect('mongodb://localhost/admin',{
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useFindAndModify: false,
  useCreateIndex: true
});

var commentSchema = new Schema({
	id:{
		type:String,
		required:true
	},
	msg:{
		type:String,
		required:true 
	},
	create_date:{
		type:Date,
		default:Date.now
	}
})

//导出
module.exports = mongoose.model('Comment',commentSchema)